/**
 * 
 */
package fhq.hcmute.modernshopping;

import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import android.content.Context;
import android.media.MediaPlayer;

/**
 * @author: Hien Nguyen Le
 * @emai: hien.nguyenle.it@gmail.com
 * 
 */
public class ProjectUtil {
	public static final String WEB_SERVICE_LINK = "http://192.168.79.1/ModernShoppingService.svc/";
	public static final String GOOGLE_DIRECTION = "http://maps.google.com/maps?f=d&daddr=%s,%s";
	public static final String GOOGLE_GEOCODE = "geo:%s,%s?q=%s,%s(%s)";

	public static String formatCurrency(double value) {
		DecimalFormat format = new DecimalFormat("#,###");
		return format.format(value);
	}

	public static String getTime(Date dateTime) {
		DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss dd/MM/yyyy ");
		dateFormat.format(dateTime);
		Calendar cal = Calendar.getInstance();
		return dateFormat.format(cal.getTime());
	}

	public static void playSound(final Context mContext, final int soundID) {
		MediaPlayer beepSound = MediaPlayer.create(mContext, soundID);
		beepSound.start();
	}
}
